1. Field of the Invention
The present invention relates to a semiconductor device and particularly to a semiconductor device capable of retaining data even when the supply of power is stopped and a method for driving the semiconductor device.
2. Description of the Related Art
The increase in operating frequency and miniaturization of elements have been researched and developed to improve performance and reduce power consumption of semiconductor devices such as micro processing units (MPUs). On the other hand, power consumption of semiconductor devices due to leakage power caused by miniaturization of elements has been steadily increased.
To deal with the problem of increased power consumption, recent attention has been focused on a technique of saving data in a non-volatile memory device and stopping the supply of power to circuits other than a circuit that needs to operate.
For example, Patent Document 1 discloses a structure in which magnetoresistive random access memory (MRAM) is used as a non-volatile memory element. In the structure disclosed in Patent Document 1, data is saved from a processor to a non-volatile memory device provided outside the processor before the supply of power is stopped, and the data saved in the non-volatile memory device is restored to the processor when the supply of power is resumed.
Patent Document 2 discloses a structure in which data is encrypted when the data is saved from a processor to a non-volatile memory device. In the structure disclosed in Patent Document 2, the processor is reset when data obtained by decrypting encrypted data is incorrect.